#include"../include/grid_face.h"
GridFace::GridFace(const GridFace& face)
{
	parent_ = face.parent_;
	nodeIndexVec_ = face.nodeIndexVec_;
	neibor_element_index_ = face.neibor_element_index_;
}
vector<Point> GridFace::GetNodeCoord() const
{
	vector<Point>coord_vec(nodeIndexVec_.size());
	for (size_t iCoord = 0; iCoord < coord_vec.size(); ++iCoord)
	{
		coord_vec[iCoord] = *parent_->GetNodeCoord(iCoord);
	}
	return coord_vec;
}
void GridFace::AddNeiborElement(int element_index)
{
	for (size_t iElem = 0; iElem < neibor_element_index_.size(); ++iElem)
	{
		if (element_index == neibor_element_index_[iElem])
			return;
	}
	neibor_element_index_.push_back(element_index);
}
bool GridFace::operator==(const GridFace& face)const
{
	if (parent_ != face.parent_)
		return false;
	else if (GetNodeNum() != face.GetNodeNum())
		return false;
	for (size_t iNode = 0; iNode < GetNodeNum(); ++iNode)
	{
		if (GetNodeIndexVec()[iNode] != face.GetNodeIndexVec()[iNode])
			return false;
	}
	return true;
}